<template>
    <div>
      <h3>{{mag}}</h3><h3 style="color: #ec5a5b">{{mes}}</h3>
    </div>
</template>

<script>
  export default {
    name: 'ALiPay',
    data(){
      return{
        mag:'',
        mes:'',
        time:5
      }
    },
    mounted () {
      debugger
      var fupath=this.$route.fullPath
      var url=fupath.split("?")[1]
      this.$http.get("/alipay/checks?"+url).then((res) => {
        if (res.data.success) {
          this.mag=res.data.message
          let ti = window.setInterval(()=>{
            this.mes=this.time--+'秒后跳转到主页';
            if(this.time<0){
              window.clearInterval(ti)
              this.time=5
              this.$router.push("/CustomerHome")
            }
          },1000)
        } else {
          this.mag=res.data.message
        }
      });
    }
  }
</script>

<style scoped>

</style>
